<template>
	
	  
	  
	<el-table class="mb20" :data="tableData" border style="width: 100%">
		<el-table-column prop="index" label="顺序" />
		<el-table-column prop="name" label="姓名" />
		
		
		<el-table-column prop="ssbm" label="部门" />
		<el-table-column prop="numbers" label="电话号码" />
	    <el-table-column prop="jifen" label="积分" />
		
	</el-table>
	
	
	
	
</template>

<script lang="ts">

			

	import QRCode from 'qrcodejs2'
	import moment from "moment"
	import editorWang from '../components/wangEnduit'
	import {
		ElMessageBox,
		ElMessage
	} from 'element-plus'
	export default {
		components:{
			editorWang
		},
		watch:{
			times(){
				this.form.starttime=this.times[0];
				this.form.endtime=this.times[1];
			},
		},
		data() {
			return {
				viewarr:[],
				modalStatewins:false,
				hdqtxmname:"",//     名称
				hdorders :"",//   加排序
				numbers :"",//  手机
				modalStatewin:false,
				qrcode:null,
				modalStatecode:false,
				vtimes:['',''],
				formLabelWidth: '120px',
				times:"",
				form: {
					title:"",
					img:"",
					anlink:"",
					orders:"",
					
					
				},
				tableData:[],
				rules: {
				        
						
						
				},
				pid: []
			}
		},
		mounted() {
			this.getData();		
		},
		methods: {
			
			
			edites(data){
				console.log(data.row)
				data.row.is_show=data.row.is_show+'';
				delete data.row.ewmid;
				var data =JSON.parse(JSON.stringify(data.row))
				this.times=[data.starttime,data.endtime];	
			},
			
           
			getData() {
				this.$http.get("/index.php/index/Goods/userlist").then(data => {
					data.forEach((t,i)=>{
						t.index=i+1;
					})
					this.tableData=data;

				})
			},
			submit(ref) {
				console.log(this.$refs)
				this.doRules(this.$refs[ref]).then(()=>{
					if (this.id) this.form.id = this.id;
					
					this.$http.post(this.id ? '/index.php/index/Goods/banneredit' : "/index.php/index/Goods/banneradd",
						this.form).then(data => {
						console.log(data)
						this.modalState = false;
						ElMessage({
							message: this.id ? '编辑成功' : '新增成功',
							type: 'success',
						})
						this.getData();
					})
				})
				
			},
			remove(data){
				this.$http.post("/index.php/index/Userinfo/hddel",{id:data.row.id}).then(data => {
					ElMessage({
						message: '删除成功' ,
						type: 'success',
					})
					this.getData();
				})
			},
			handleAvatarSuccess(file) {

				this.form.image = file.data;
			},
			


		}
	}
</script>
